#ifndef BSP_CAN_H
#define BSP_CAN_H

#include "can.h"

extern void can_filter_init(void);

typedef enum {
	
	CAN_6020_ALL_ID = 0x1FF,
	CAN_6020_M1_ID = 0x205,
	CAN_6020_M2_ID = 0x206,
	CAN_6020_M3_ID = 0x207,
	CAN_6020_M4_ID = 0x208,
	
	CAN_6020_MAXV = 24999,
	CAN_6020_MAXrpm = 320,
	
	CAN_3508_ALL_ID = 0x200,
	CAN_3508_M1_ID = 0x201,
	CAN_3508_M2_ID = 0x202,
	CAN_3508_M3_ID = 0x203,
	CAN_3508_M4_ID = 0x204,
	
	CAN_3508_MAXI = 16383,
	CAN_3508_MAXrpm = 19 * 400,
		
} can_msg_id_e;

typedef struct {
	
	unsigned short ecd; //angle
	short speed_rpm; 
	short given_current; // I
	char temperate; 
	short last_ecd;
	
} motor_measure_t;

extern void CAN_cmd_chassis(int16_t *speed);
extern void CAN_cmd_gimbal(int16_t *speed);

extern motor_measure_t motor_data[6];

extern void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan);

#endif
